package com.harveyspace.aes.core.response;

import com.harveyspace.aes.core.model.FrontendPageBean;

/**
 * 分页返回基类，对外接口中使用
 *
 * @Author <a href="harveyer@163.com">harvey</a>
 * @date 2017/6/23
 * @since 1.0.0
 */
public class BasePageResponse<T> extends BaseResponse<T>{

    /**
     * 分页信息
     */
    private FrontendPageBean paging;

    /**
     * 构造 BasePageResponse 的静态方法
     *
     * <pre>
     * BasePageResponse.builder().data("some data..").code(200)
     * </pre>
     *
     * @return BasePageResponse
     */
    public static <T> BasePageResponse<T> builder() {
        return new BasePageResponse<T>();
    }

    public FrontendPageBean getPaging() {
        return paging;
    }

    public BasePageResponse<T> paging(FrontendPageBean paging) {
        this.paging = paging;
        return this;
    }

    @Override
    public BasePageResponse<T> code(Integer code) {
        this.code = code;
        return this;
    }

    @Override
    public BasePageResponse<T> message(String message) {
        this.message = message;
        return this;
    }

    @Override
    public BasePageResponse<T> data(T data) {
        this.data = data;
        return this;
    }

    @Override
    public BasePageResponse<T> extraParam(Object extraParam) {
        this.extraParam = extraParam;
        return this;
    }

}
